
// src/pages/CreateVM/Step5Review.tsx
import React from 'react';
import { Descriptions, Switch } from 'antd';
import { VMConfig } from './CreateVMWizard';

interface Step5Props {
  config: VMConfig;
}

const Step5Review: React.FC<Step5Props> = ({ config }) => {
  return (
    <Descriptions title="配置确认" bordered column={1}>
      <Descriptions.Item label="虚拟机名称">{config.name}</Descriptions.Item>
      <Descriptions.Item label="描述">{config.description || '无'}</Descriptions.Item>
      <Descriptions.Item label="操作系统">{config.osType}</Descriptions.Item>
      <Descriptions.Item label="CPU">{config.vcpus} vCPU</Descriptions.Item>
      <Descriptions.Item label="内存">
        {(config.memory / 1024).toFixed(1)} GB (最大 {(config.maxMemory / 1024).toFixed(1)} GB)
      </Descriptions.Item>
      <Descriptions.Item label="磁盘">{config.diskSize} GB</Descriptions.Item>
      <Descriptions.Item label="存储池">{config.storagePool}</Descriptions.Item>
      <Descriptions.Item label="网络类型">{config.networkType}</Descriptions.Item>
      {config.networkInterface && (
        <Descriptions.Item label="网络接口">{config.networkInterface}</Descriptions.Item>
      )}
    </Descriptions>
  );
};

export default Step5Review;